data(freqsNLsgmplus)
x <- sample.profiles(N=10,freqsNLsgmplus)
y <- unclass(x);attr(y,"freqs") <- NULL
stopifnot(identical(as.vector(x[1,]),as.vector(y[1,])))
stopifnot(identical(as.vector(x[1:10]),as.vector(y[1:10])))
stopifnot(identical(as.vector(x[5,5]),as.vector(y[5,5])))
stopifnot(identical(as.vector(x[,1:10]),as.vector(y[,1:10])))
stopifnot(identical(as.vector(x[,]),as.vector(y[,])))
stopifnot(identical(as.vector(x[cbind(2,1:10)]),as.vector(y[cbind(2,1:10)])))
Run the code above in your browser using DataLab